<template>
    <div>
        <!-- 面包屑导航 -->
        <el-bread></el-bread>
        <!-- 添加按钮 -->
        <el-button @click="addDialog" class="btnInfo" type="primary" size="small" plain>添加</el-button>
        <!-- 列表展示 -->
        <v-list @edit="edit"></v-list>
        <!-- 弹框 -->
        <v-dialog ref="diaInfo" @cancel="cancel" :isShow="isShow" :isAdd="isAdd"></v-dialog>
    </div>
</template>

<script>
import vList from './list.vue'
import vDialog from './dialog.vue'
export default {
    data() {
        return {
            isShow: false,
            isAdd:true
        }
    },
    components:{vList,vDialog},
    methods: {
        addDialog() {
            this.isShow = true
            this.isAdd = true
        },
        cancel(e) {
            this.isShow = e
        },
        edit(e) {
            this.isShow = true
            this.isAdd = false
            this.$refs.diaInfo.lookup(e)
        }
    }
}
</script>

<style scoped>
.btnInfo{
    margin: 20px 0px 5px 1px;
}
</style>